The self-moving robot has been widely used for its convenient operation and free walking, and it can realize a variety of applications, including windows-wiping, floor-sweeping, air purification and so on. One walking method of the existing self-moving robot is the random walking method, under which walking method, when the robot meets an obstacle, it firstly moves back in its original moving direction so that there is enough space left between the robot and the obstacle, and then the body of the robot turns a certain small angle in the clockwise or anticlockwise direction and continues to walk. If the robot still meets an obstacle here, it will repeat the action of moving back and turning until it avoids the obstacle, and then the robot continues to walk. However, the walking tracks of the existing robot using this kind of local obstacle avoidance method are random and complex, which wastes plenty of work time and power, leading to a low efficiency of the obstacle avoidance. On the other hand, when the robot continues to walk after successfully avoiding the local obstacle, there will be a lot of missing regions left behind or around the obstacle which are unable for the robot to reach, so that the cleaning effect is poor.